var CandidateVideo = {
	getVideoGrid: function() {
		ajax({
			  url: baseURL + "candidate/video",
			  cache: false,
			  type: "POST",
			  data: $('#ajax_form').serialize(),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridVideos').html(data);
			  }
			});
	},
	
	watchVideo: function(video_type, video_link) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "candidate/video/watch/" + video_type + '/' + video_link,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	editVideo: function(video_type, idvideo) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "candidate/video/edit/" + video_type + '/' + idvideo,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	processVideo: function() {
		ajax({
		  url: baseURL + "candidate/video/" + ($('#idvideo').val() ? 'update' : 'insert'),
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	deleteVideo: function(idvideo) {
		ajax({
			  url: baseURL + "candidate/video/delete",
			  cache: false,
			  type: "POST",
			  data: 'id=' + idvideo,
			  async: false,
			  dataType: 'script'
			});
			
			return false;
	},
	
	updatePresentation: function(video_id) {
		ajax({
		  url: baseURL + "candidate/video/update_presentation/" + video_id,
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	}
};